<template>
  <div id="brand_detail">
    <div class="detail-table">
      <Row>
        <Col span="24" class="detail-table__col detail-table__title">品牌详情</Col>
      </Row>
      <Row>
        <Col span="12" class="detail-table__col">
          品牌名称：{{detailMsg.brandName}}
        </Col>
        <Col span="12" class="detail-table__col">
          品牌首字母：{{detailMsg.initial}}
        </Col>
      </Row>
      <Row>
        <Col span="24" class="detail-table__col">状态：{{detailMsg.isShow === 0 ? '隐藏' : detailMsg.isShow === 1 ? '显示': ''}}</Col>
      </Row>
      <Row>
        <Col span="12" class="detail-table__col">
          创建时间：{{detailMsg.operatedAt}}
        </Col>
        <Col span="12" class="detail-table__col">
          编辑时间：{{detailMsg.updatedAt}}
        </Col>
      </Row>
      <Row>
        <Col span="12" class="detail-table__col">
          创建人：{{detailMsg.creatorName}}
        </Col>
        <Col span="12" class="detail-table__col">
          编辑人：{{detailMsg.updaterName}}
        </Col>
      </Row>
      <Row>
        <Col span="24" class="detail-table__col">
          <table>
            <tr>
              <td width="72" valign="top">品牌简介：</td>
              <td>{{detailMsg.brandDesc}}</td>
            </tr>
          </table>
        </Col>
      </Row>
      <Row>
          <Col span="24" class="detail-table__col">
            <table>
              <tr>
                <td width="72" valign="top">品牌LOGO：</td>
                <td><img :src="detailMsg.logo"></td>
              </tr>
            </table>
          </Col>
        </Row>
    </div>
  </div>
</template>

<script>
import { detailBrand } from '@/api/commondity/index'
export default {
  name: 'brand_detail',
  data () {
    return {
      brandId: '',
      detailMsg: {}
    }
  },
  methods: {
    getDetail () {
      detailBrand({
        merchantId: this.$store.state.user.merchantId,
        brandId: this.brandId
      }).then(res => {
        const result = res.data || {}
        if (result.status === 200) {
          this.detailMsg = result.data
        } else {
          this.$Message.error(`${result.error}`)
        }
      }).catch(err => {
        this.$Message.error(`${err}`)
      })
    }
  },
  mounted () {
    this.brandId = this.$route.params.id
    this.getDetail()
  }
}
</script>

<style lang="less">
@import '~@/assets/stylus/detail-table.less';
#brand_detail{
  padding: 40px 80px;
}
</style>
